import { Entity } from "../../../../../Core/Module/Entity/Entity";
import { Scene } from "../../../../../Core/Module/Entity/Scene";
import { IAwake } from "../../../../../Core/Module/EventSystem/IAwakeSystem";
import { ILoad } from "../../../../../Core/Module/EventSystem/ILoadSystem";
import { ComponentOf } from "../../../../../Decorator/Decorator";
import { Dictionary } from "../../../../../Support/Share/Lib/Dictionary";
import { CancellationTokenSource } from "../../../../../Support/Share/Lib/Threading/CancellationTokenSource";
import { IConsoleHandler } from "./IConsoleHandler";

export class ConsoleMode {
    public static readonly ReloadDll: string = "R";
    public static readonly ReloadConfig: string = "C";
    public static readonly ShowMemory: string = "M";
    public static readonly Repl: string = "Repl";
    public static readonly Debugger: string = "Debugger";
    public static readonly CreateRobot: string = "CreateRobot";
    public static readonly Robot: string = "Robot";
}

@ComponentOf(Scene)
export class ConsoleComponent extends Entity implements IAwake, ILoad {

    public CancellationTokenSource: CancellationTokenSource;
    public Handlers = new Dictionary<string, IConsoleHandler>();

}